import request from "@/utils/request";

// 公告列表 rule/1
export const getRoleList = (page: number) => {
    return request({
        url: `/role/${page}`,
        method: "get",
    });
};

// 修改状态 /rule/:id/update_status
export const changStatus = (id: number, data: object) => {
    return request({
        url: `/role/${id}/update_status`,
        method: "POST",
        data,
    });
};

// 添加内容 /rule

export const addRole = (data: object) => {
    return request({
        url: `/role`,
        method: "POST",
        data,
    });
};
// 修改内容
export const editRole = (id: number, data: object) => {
    return request({
        url: `/role/${id}`,
        method: "POST",
        data,
    });
};
// 删除
export const delRole = (id: number) => {
    return request({
        url: `/role/${id}/delete`,
        method: "POST",
    });
};
// 配置角色权限
export const setRole = (data: object) => {
    return request({
        url: `/role/set_rules`,
        method: "POST",
        data
    });
};